using System;
using System.Collections.Generic;
using NHibernate.Search.Attributes;
using NHibernate.Search;

namespace Ic.Model
{
	#region FellowShip

	/// <summary>
	/// FellowShip object for NHibernate mapped table 'TB_FellowShip'.
	/// </summary>
	[Serializable]
	[TableInfo(TableName = "TB_FellowShip", PrimaryKey = "Id" , Columns="Id,UserId,FollowId,FollowUserType,RegDate")]
	[Indexed(Index = "FellowShip")] 
	public class FellowShip
	{
		#region Member Variables
		
		protected int _id;
		protected int _userId;
		protected int _followId;
		protected string _followUserType;
		protected DateTime _regDate;

		#endregion

		#region Constructors

		public FellowShip() { }

		public FellowShip( int userId, int followId, string followUserType, DateTime regDate )
		{
			this._userId = userId;
			this._followId = followId;
			this._followUserType = followUserType;
			this._regDate = regDate;
		}

		#endregion

		#region Public Properties

		[DocumentId]
		public virtual int Id
		{
			get {return _id;}
			set {_id = value;}
		}

		public virtual int UserId
		{
			get { return _userId; }
			set { _userId = value; }
		}

		public virtual int FollowId
		{
			get { return _followId; }
			set { _followId = value; }
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string FollowUserType
		{
			get { return _followUserType; }
			set
			{
				if ( value != null && value.Length > 10)
					throw new ArgumentOutOfRangeException("Invalid value for FollowUserType", value, value.ToString());
				_followUserType = value;
			}
		}

		public virtual DateTime RegDate
		{
			get { return _regDate; }
			set { _regDate = value; }
		}

		

		#endregion
	}
	#endregion
}